#include "all.h"
float x=0;
/*电池显示*/
tTime   Time_Battery;

/*电池显示开启*/
void Battery_Display_Set(void)
{
	Time_Battery.Num = 3;	
}
/*电池显示关闭*/
void Battery_Display_Dis(void)
{
	Time_Battery.Num = 0;	
}
/*电池显示任务*/
void Battery_Display(void)
{
	if(Charge == Afoot)return;  /*充电就不显示*/
	switch(Time_Battery.Num)
	{
		case 0:
			break;
		case 1:
			Time_Battery.MS = 500;
			Time_Battery.Num += 1;
			break;
		case 2:
			if(Time_Battery.MS <= 0)Time_Battery.Num += 1;
			break;
		case 3:	
			x=Voltage_Value(0);
		    //lv_label_set_text_fmt(icon_Countdown,"%.4f",x);
			if(x>=4.0f)Time_Battery.Num = 4;
			else
			if(x<4.0f&&x>=3.8f)Time_Battery.Num = 5;
			else
			if(x<3.8f&&x>=3.6f)Time_Battery.Num = 6;
			else
			if(x<3.6f&&x>=3.3f)Time_Battery.Num = 7;
			else					
			if(x<3.3f)Time_Battery.Num = 8;				
			break;
		case 4: /*电池3/4*/
			Chinese_Show_one(180,40,4,32,0);
			Time_Battery.Num = 1;
			break;	
		case 5: /*电池2/4*/
			Chinese_Show_one(180,40,3,32,0);
			Time_Battery.Num = 1;
			break;	
		case 6: /*电池1/4*/
			Chinese_Show_one(180,40,2,32,0);
			Time_Battery.Num = 1;
			break;		
		case 7: /*电池0/4*/
			Chinese_Show_one(180,40,1,32,0);
			Time_Battery.Num = 1;
			break;	
		case 8: /*低电压报价*/
			Chinese_Show_one(180,40,1,32,0);
			Time_Battery.Num = 1;
			break;			
	
	}	
}	

/*电池显示任务*/
void Battery_Task(void)
{
	Battery_Display();
}

	

